﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Mobile_New_Login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=2.0,maximum-scale=1,user-scalable=no" />
    <title></title>

    <link rel="stylesheet" type="text/css" href="../New/css/login.css" />
    <link rel="stylesheet" type="text/css" href="../New/css/index.css" />
    <style type="text/css">
        * {
            margin: 0px;
            padding: 0px;
            list-style: none;
        }

        a, img, button, input, textarea {
            -webkit-tap-highlight-color: rgba(255,255,255,0);
        }

            a:active {
                outline: hidden;
            }

        .a_header {
            width: 100%;
            height: 50px;
            background: #fff;
            position: fixed;
            top: 0px;
            left: 0px;
            border-bottom: 1px solid #ddd;
        }

            .a_header .header_middle {
                width: 100%;
                height: 50px;
                line-height: 50px;
                text-align: center;
                font-size: 20px;
            }

            .a_header .a_header_l1 .h_l1 {
                width: 35px;
                height: 25px;
                background: url("../images/header_02.png") no-repeat;
                background-size: 10px 15px;
                margin: 16px 0px 0px 15px;
                position: absolute;
            }

            .a_header .a_header_l1 .h_l2 {
                width: 60px;
                height: 45px;
                position: fixed;
                left: 35px;
                top: 16px;
                color: #000;
                font-size: 14px;
            }

        body {
            background: #f0f0f0;
        }

        .content {
            /*padding-top: 51px;*/
        }

        #forget_pwd_a {
            font-size: 12px;
            color: #000;
        }

            #forget_pwd_a:hover {
                color: #f00;
            }
    </style>
    <script type="text/javascript">
        function onBridgeReady() {
            WeixinJSBridge.call('hideToolbar');
            WeixinJSBridge.call('hideOptionMenu');
        }

        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="content">



            <div class="cont_middle">
                <div class="cont_middle_1">
                    <li>
                        <div class="co_mid_left">
                            <img src="../New/images/my_04.png" />
                        </div>
                    </li>
                    <li>
                        <div class="co_mid_right">
                            <input type="text" placeholder="请输入手机号" id="memname" />
                        </div>
                    </li>
                </div>


                <div class="cont_middle_1">
                    <li>
                        <div class="co_mid_left">
                            <img src="../New/images/my_06.png" />
                        </div>
                    </li>
                    <li>
                        <div class="co_mid_right">
                            <input type="password" placeholder="请输入密码" id="telnumber" />
                        </div>
                    </li>
                </div>

            </div>

            <div class="cont_footer">

                <div class="cont_footer_all">
                    <div class="cont_footer_1" style="width: 100%;">

                        <div class="cont_footer_1_1" id="loginSumbit">
                            登录
                        </div>

                    </div>
                    <%-- <div class="cont_footer_1">
                        <a href="Register.aspx">
                            <div class="cont_footer_2_2">
                                注册
                            </div>
                        </a>
                    </div>--%>
                    <%-- <div style="text-align: right; padding: 5px 3% 0 0"><a href="Default.aspx?pageid=forgetpwd" id="forget_pwd_a">忘记密码？</a></div>--%>
                </div>
            </div>

        </div>


        <input type="hidden" id="hidUrl" runat="server" />
    </form>
</body>
<script type="text/javascript" src="../New/js/jquery-1.11.1.min.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $("#loginSumbit").click(function () {
            var uid = $.trim($("#memname").val());
            var pwd = $.trim($("#telnumber").val());

            if (uid == "") {
                alert("卡号不能为空！")
                return;
            }
            $.get("/Service/AjaxService.ashx?Method=WeiXinLoginNew",
        {
            "uid": uid,
            "pwd": pwd,
        }
        , function (text) {
            if (text == "2") {
                var url = "GoodsList.aspx?code=" + GetGuid();
                window.location.href = url;
                return;
            }
            else if (text == "4") {
                alert('您的卡号已锁定，暂时无法登录');
                return;
            } else if (text == "5") {
                alert('您的卡号已过期，暂时无法登录');
                return;
            }
            else {
                $("#memname").val("");
                $("#telnumber").val("");

                alert("登录失败，用户名或密码错误！");

            }

        }, "text")
        })
    });

    function GetGuid() {
        var now = new Date();
        var year = now.getFullYear(); //getFullYear getYear
        var month = now.getMonth();
        var date = now.getDate();
        var day = now.getDay();
        var hour = now.getHours();
        var minu = now.getMinutes();
        var sec = now.getSeconds();
        var mill = now.getMilliseconds();
        month = month + 1;
        if (month < 10) month = "0" + month;
        if (date < 10) date = "0" + date;
        if (hour < 10) hour = "0" + hour;
        if (minu < 10) minu = "0" + minu;
        if (sec < 10) sec = "0" + sec;
        var guid = month + date + hour + minu + sec + mill;
        return guid;
    }

</script>


</html>
